package com.jiyun.h2303b.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "9021000133682570";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCFI4NzJ1zQruypi+kt0FegwSWARTEK6+8uJYMG7JwpFRXhjvLW+7a8hzKrX+WGW6yIZlNgoQ8MKjpYJ73QQlEaRJ2XoYtMXWWkpkGNsXO+WDcq29XDGJqco/aHPAD2i/rC/wYnv/uk4EU9+RoW2eN0MuEo5hsPeYYi1SQvbJ41ADZ0+STdBH7lhZ7P3Tr9xAw9wt6iowzoe6OO/yma/8qFNE8Pr5GhN8hb6hz/omWdfXWQ/BYWOatYgXX2RSOQiNTl8+vGK8uyhZK24xOOOcItoBBcKL//M8sp4N+P5e+SvL3Xgr1jFuEWBGppIHSK5Z3tSbwcQZ5EfoLewtAED6RBAgMBAAECggEAcBvMZ13g4PQ64jWm3uYNs5aQTmd0+X5cA96ga2c3w7w2lZ06TN7eK/goKXhxnGZ7bMvFL5vPQO4Z/PtR8Ri2lEjs7q6fzmji2vcIQhkHnmNH6PX+FO8V2gqS36MeKH0MZcA63aPicR5MD/g/CLjmt4TUZg0FAk3RLmmNs8VhnrxWiD/BznnHmnyI+NEnJw2ADqPwktEsBo0u5z0NcRhOJMphQEQam8iPvScAOQ2WG9YTzZKX0wzvZ4ztj8uJQ6GulYELjzqiuwkmdzvzhxZbztwoIRwoexDu+V3zIsSiwMdqaxikzySC4TR+PBubFe0BFPh8vy3gf/CgwgVRiY0QsQKBgQDjB33c17NRYpkiRceVX8Nas2O15yWqhRC5GzjfoNM0CZ83ut+hc0v1382DI5X89qNXBmqAuES/T5ksCu1BPRVlFJSUfawzOcEFbAcThlgMqOgYdCeh3fc0sUIY7tlD/D4Ix6pUbiS7nKJV+6kFrBL4owTl2Tu5I/N4zOwIFkjHlQKBgQCWINcb4oImlZEpgo4S8mL8z7Nh+5GUEDxd2A4FvNuZnkPsYrfZSDbDCwi53jYK5GQwlqDK7z1/A0T/Wq/NEJ9hZ1/T5wdZipiFeolXBSGdmCpMvyN68Ko/XndaEeSPPySUvEGHYncVnWvcfQt6uG43mQpFiaOEuxMwZMOs20dO/QKBgHpAv4Mb2GEcAjBVeSsz3UPLVAdRSJQxgZbcVNz/gpwEDmv5QpFzP9VQRh+3Gv6UZdLoDpPwJn0KxQXVgHtgBFRhJ71qiz8ue4WK7aiS8Hkov4rjia/9kjAav+gjPnYAr/sUYeGDSl6I81Xv5c27IqAnUOzg9Os2s9Y6K2QTc++dAoGAPuNA2Kh4tqr+pPHQi/VHK/nhfdEA+ZIXh4Qi05p6Lw6SC2qK8xUCA5AStrFz1/o2Ufg3IOs4yoTXGVSmwfMNoKLKDJ0BgivBmmBrOa2nmDmOtpl2xmAcIPF0c6F9KdhcfYWiuZCwq7hG35TuAxlQ6i9MkzaF7erjrej34uf0Jg0CgYEAo5eeL+UEmBWEPJDTg9ND9NmbupOwSdLasrfaVKdSKYn+VrH2zqtZPYVnb2H05g1f/Q+QL7LkT3txj0hpUbo3LxyX0xMihOB8eoJZSxtXC6Mpq/ihXw8RVVusSd6S3Crry859lowVGwgT2HYPH6DJqyWSYEfQLq8PxYatyFI3As0=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArnjOK0MCU6UyQq5XkvxQjtOO6pjnyoq8AzQMs9OhSTdYQjwmyE4xqkc/HaIAC0GeImyKlyfVvR7iKC5XQt00PKvfhejiVfKr40kyUfDDlLVhmUjsKA73U7kE+/9PbFgXmQWaRWXDtTm5AcIR5oF951u2PsyYkphoot50hxT0LVxnRhT1rYZdVCAh/2T0Q+8iKPVL5yc76lt3wNgerE7/hv11uTbus8WAjzWrgSjGwdOcw1n9hQeE+GQhzOuANE5Gxc97OE6CjQd+b/pbxsp/UCU9h411XJhMG4wlmEHLn9IIe9WnV7FhO0zh8Jf6icJ1ye+qjRL8X51Gs5xz7IfnzwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8081/#/PaySuccess";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8081/#/PaySuccess";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

